package io.renren.modules.weixin.controller;

import io.renren.modules.weixin.Service.ZbAdminService;
import io.renren.modules.weixin.Service.ZbResultService;
import io.renren.modules.weixin.entity.ZbAdminEntity;
import io.renren.modules.weixin.entity.ZbResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author: Mr-wang
 * @date: 2018/4/25 0025 16:23
 * @Description:
 */
@RestController
@RequestMapping("/phone")
public class phoneController  extends AbstractController{
    @Autowired
    private ZbAdminService zbAdminService;
    @Autowired
    private ZbResultService zbResultService;

    @PostMapping("/getdata")
    public ZbAdminEntity getData(@RequestBody ZbAdminEntity zbparams){
      return zbAdminService.selectByzbCodeAndcreator(zbparams.getZbCode(),zbparams.getCreator());
    }

    @PostMapping("/getline")
    public List<ZbResultEntity> getLine(@RequestBody ZbAdminEntity zbparams){
        return zbResultService.selectLineByZbCode(zbparams.getZbCode());
    }

    @GetMapping("/getlist")
    public List<ZbAdminEntity> getList(@RequestParam Map<String, Object> params){
        return zbAdminService.selectList();
    }
}